Repository navigation
fix(check): Socket scan fails closed — not-logged-in Socket can't pass → 1.25.1 - #100
Merged
Merged
Conversation
checkSocket treated non-JSON `socket check` output as "passed" (catch→pass + bare exit-0→pass), so an installed-but-unauthenticated Socket — which looks like it runs but checks nothing — could report green "no supply chain issues" and give false assurance. Now `pass` requires positive proof the scan ran (valid result JSON); not-logged-in / unparseable / non-zero-exit all surface as "socket NOT scanning — supply chain UNVERIFIED" with a socket login hint. Decision logic extracted to a pure, fixture-tested classifySocketResult. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
✅ Docker image built successfully
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug (false green)
checkSockettreated any non-JSONsocket checkoutput as "passed" —catch { /* passed */ }then a bare exit-0 →status: pass, "no supply chain issues detected". So an installed-but-unauthenticated Socket — which appears to run but checks nothing — could report a green supply-chain result and give false assurance you're covered.Fix (fail closed)
A
passnow requires positive proof the scan ran (valid result JSON). Everything else surfaces loudly, never as pass:warn: "socket NOT scanning — not logged in; supply chain UNVERIFIED" (+socket loginhint)warn: "no parseable result — supply chain UNVERIFIED"warn: "socket check failed"Decision logic extracted to a pure
classifySocketResult(raw, ok), fixture-tested (6 cases incl. the false-green guard).Same fail-closed principle as #74 (
kit scan);checkSemgrepwas already fail-closed (pass requires a successful parse).Verify
check-securitytests 16/16 incl. newclassifySocketResultsuite.🤖 Generated with Claude Code